<!DOCTYPE html>
<html lang="zh-Hans" >
<head>
    <title>随访信息详情</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chorme=1">
    <meta name="renderer" content="webkit">
    <script src="/static/cqzd/js/boot.js"></script>
    <script src="/static/cqzd/js/national.js"></script>
</head>
<style>
    .t1{ width: 20%;
        height:3.5%;
        background: #4cc159;

    }
    .t3{
        width: 20%;
        height: 3.5%;
        background: #1a9ff1;
    }

    .t2{
        width: 20%;
        height: 3.5%;
        background:  green;

    }
    .active{
        width: 20%;
        height: 3.5%;
        background:yellow;

    }
    .t4{
        width: 20%;
        height: 3.5%;
        background: #1b6d85;
    }
    .fiend{
        position: sticky;
        left: 0;
        pointer-events: none;
        overflow: scroll;
    }

</style>

<body style="height: 97%">

<div style="padding:5px;">
    <div class="search-condition">
        <div class="list">
            <div id="form1">
                <input id="mark" class="mini-textbox" name="mark" value="1" style="display: none"/>
                <table style="width:80%;padding:5px;" class="table" >
                    <tr>
                        <td colspan="3" align="left">
                            <div class="mini-autocomplete" name="queryParem" style="width:300px"
                                 popupWidth="400" textField="patientName" EmptyText="身份证号/姓名/姓名简拼/卡号" valueField="patientName"
                                 url="/cqzd/do/diacinfo/queryDiacrisisInfo"  onvaluechanged="onValueChanged" >
                                <div property="columns">
                                    <div header="患者姓名" field="patientName" width="30"></div>
                                    <div header="身份证号" field="patientCardId"></div>
                                </div>
                            </div>
                        </td>
                        <td class="form_label">
                            登记时间
                        </td>
                        <td colspan="3">
                            <table style="border: 0px; background-color: transparent"
                                   border="0" cellspacing="0" cellpadding="0">
                                <tr style="border: 0px none; background-color: transparent;">
                                    <td style="border: 0px none; background-color: transparent;">
                                    </td>
                                    <td style="border: 0px none; background-color: transparent;">
                                        <input id="statrDate" class="mini-datepicker" name="starDate"
                                               format="yyyy-MM-dd"
                                               showTime="true"  allowInput="false"
                                               style="width: 200px"  />
                                    </td>
                                    <td style="border: 0px none; background-color: transparent;">
                                        到:</td>
                                    <td style="border: 0px none; background-color: transparent;">
                                        <input class="mini-datepicker" name="endDate"
                                               format="yyyy-MM-dd"
                                               showTime="true"  allowInput="false"
                                               style="width: 200px"ondrawdate="onDrawDate"  />
                            </table></td>

                        <td>
                            <input class="mini-button" text="查询"   onclick="search" iconCls="icon-search" />
                        </td>
                        <td>
                            <input class="mini-button" text="导出" onclick="export_file" iconCls="icon-search"/>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

<div class="mini-fit" style="padding:0px 5px 5px 5px;">


    <div id="datagrid1"
         class="mini-datagrid"
         style="width:100%;height:100%;"
         idField="diacrisisId"
         url="/cqzd/patientInfo/getAllDiagnosisInfo"
         multiSelect="true"
         onrowdblclick="rowdblclick"
         sizeList="[20,30,50,100]"
         pageSize="20"
         sortMode="client"
         frozenStartColumn="0"
         frozenEndColumn="2">
        <div property="columns">

            <div headerCls="t2"    headerAlign="center"  >
                基础信息
                <div property="columns">
                    <div type="indexcolumn"  class="fiend"  width="120" headerAlign="center" align="center" allowSort="true">序号</div>
                    <div field="recordId" width="120" headerAlign="center" align="center" allowSort="true">登记编号</div>
                    <div field="patientName" width="160" headerAlign="center" align="center" allowSort="true" dateFormat="yyyy-MM-dd hh:mm:ss">姓名</div>
                    <div field="patientCardId" width="120" headerAlign="center" align="center" allowSort="true">身份证证号</div>
                    <div field="patientAge" width="160" headerAlign="center" align="center" allowSort="true">年龄</div>
                    <!--          改到此处-->
                    <div field="patientEdu" width="160" headerAlign="center" align="center" allowSort="true" >学历</div>
                    <div field="patientOccupation" width="160" headerAlign="center" align="center" allowSort="true"  dateFormat="yyyy-MM-dd">职业</div>
                    <div field="patientReligion" width="160" headerAlign="center" align="center" allowSort="true"  dateFormat="yyyy-MM-dd">宗教</div>
                    <div field="gestCount" width="160" headerAlign="center" align="center" allowSort="true"  dateFormat="yyyy-MM-dd">孕次</div>
                    <div field="prodCount" width="160" headerAlign="center" align="center" allowSort="true"  dateFormat="yyyy-MM-dd">产次</div>
                    <div field="aboCount" width="160" headerAlign="center" align="center" allowSort="true"  dateFormat="yyyy-MM-dd">流产次</div>
                    <div field="badGest" width="160" headerAlign="center" align="center" allowSort="true" >不良孕产史</div>
                    <div field="children" width="160" headerAlign="center" align="center" allowSort="true" >现存小孩</div>
                    <div field="lastMenses" width="160" headerAlign="center" align="center" allowSort="true" >末次月经</div>
                    <div field="fetusesType" width="160" headerAlign="center" align="center" allowSort="true" >单胎/双胎</div>
                    <div field="gestWeeks" width="160" headerAlign="center" align="center" allowSort="true" >初诊孕周</div>
                    <div field="expectedDate" width="160" headerAlign="center" align="center" allowSort="true" >孕产期</div>
                    <div field="drugUse" width="160" headerAlign="center" align="center" allowSort="true" >孕期孕药</div>
                    <div field="familyMedical" width="160" headerAlign="center" align="center" allowSort="true" >家族史</div>
                    <div field="specialMedical" width="160" headerAlign="center" align="center" allowSort="true" >特殊病史</div>
                    <div field="assayRemark" width="160" headerAlign="center" align="center" allowSort="true" >穿刺指征</div>
                    <div field="inspectionTime" width="160" headerAlign="center" align="center" allowSort="true" >穿刺日期</div>
                    <div field="nt" width="120" headerAlign="center" align="center" allowSort="true">NT(cm)</div>
                    <div field="crl" width="120" headerAlign="center" align="center" allowSort="true">CRL(cm)</div>
                    <div field="niptTypeName" width="120" headerAlign="center" align="center" allowSort="true">NIPT结果</div>
                    <div field="tangScreenName" width="120" headerAlign="center" align="center" allowSort="true">唐筛结果</div>
                    <div field="babnormal" width="120" headerAlign="center" align="center" allowSort="true">B超结果</div>
                    <div field="diacrisisRemark" width="120" headerAlign="center" align="center" allowSort="true">术前情况</div>
                    <!--                    HBSAG为空-->
                    <!--                    <div field="cardNo" width="120" headerAlign="center" align="center" allowSort="true">HBsAg</div>-->
                    <div field="bloodTypeName" width="120" headerAlign="center" align="center" allowSort="true">血型</div>
                    <div field="patientAddress" width="120" headerAlign="center" align="center" allowSort="true">家庭住址</div>
                    <div field="patientTel" width="120" headerAlign="center" align="center" allowSort="true">患者电话</div>
                    <div field="spouseTel" width="120" headerAlign="center" align="center" allowSort="true">家属电话</div>
                    <div field="spouseAge" width="120" headerAlign="center" align="center" allowSort="true">配偶年龄</div>
                    <div field="spouseName" width="120" headerAlign="center" align="center" allowSort="true">配偶姓名</div>
                    <div field="spouseOccupation" width="120" headerAlign="center" align="center" allowSort="true">配偶职业</div>
                </div>
            </div>

            <div header="诊断信息--羊穿"   headerCls="active"  headerAlign="center">
                <div property="columns">



                    <!--      诊断信息---羊穿--->
                    <div field="bsignYc" width="120" headerAlign="center" align="center" allowSort="true">B超标记</div>
                    <div field="afTypeNameYc" width="120" headerAlign="center" align="center" allowSort="true">羊水性状</div>
                    <div field="inspectionProcessYc" width="120" headerAlign="center" align="center" allowSort="true">过程</div>
                    <div field="fishYc" width="120" headerAlign="center" align="center" allowSort="true">FISH</div>
                    <div field="cnvYc" width="120" headerAlign="center" align="center" allowSort="true">CMV</div>
                    <div field="qfPcrYc" width="120" headerAlign="center" align="center" allowSort="true">QF-PCR</div>
                    <div field="karyotypingYc" width="120" headerAlign="center" align="center" allowSort="true">核型分析</div>
                </div>
            </div>
            <div header="诊断信息--绒穿"    headerCls="t1"    headerAlign="center">
                <div property="columns">


                    <!--诊断信息--绒穿      -->
                    <div field="bsignRc" width="120" headerAlign="center" align="center" allowSort="true">B超标记</div>
                    <div field="afTypeNameRc" width="120" headerAlign="center" align="center" allowSort="true">羊水性状</div>
                    <div field="inspectionProcessRc" width="120" headerAlign="center" align="center" allowSort="true">过程</div>
                    <div field="fishRc" width="120" headerAlign="center" align="center" allowSort="true">FISH</div>
                    <div field="cmvRc" width="120" headerAlign="center" align="center" allowSort="true">CMV</div>
                    <div field="qfPcrRc" width="120" headerAlign="center" align="center" allowSort="true">QF-PCR</div>
                    <div field="karyotypingRc" width="120" headerAlign="center" align="center" allowSort="true">核型分析</div>
                </div>
            </div>

            <div header="诊断信息--脐穿"    headerCls="t3"   headerAlign="center">
                <div property="columns">


                    <!--      诊断信息--继穿-->
                    <div field="bsignQc" width="120" headerAlign="center" align="center" allowSort="true">B超标记</div>
                    <div field="afTypeNameQc" width="120" headerAlign="center" align="center" allowSort="true">羊水性状</div>
                    <div field="inspectionProcessQc" width="120" headerAlign="center" align="center" allowSort="true">过程</div>
                    <div field="fishQc" width="120" headerAlign="center" align="center" allowSort="true">FISH</div>
                    <div field="cmvQc" width="120" headerAlign="center" align="center" allowSort="true">CMV</div>
                    <div field="qfPcrQc" width="120" headerAlign="center" align="center" allowSort="true">QF-PCR</div>
                    <div field="karyotypingQc" width="120" headerAlign="center" align="center" allowSort="true">核型分析</div>
                </div>
            </div>

            <div header="随访患者信息"  headerCls="t4"   headerAlign="center">
                <div property="columns">

                    <!--随访患者信息-->
                    <div field="flupTime" width="120" headerAlign="center" align="center" allowSort="true">随访时间</div>
                    <div field="gestResultName" width="120" headerAlign="center" align="center" allowSort="true">妊娠结果</div>
                    <div field="nbcSex" width="120" headerAlign="center" align="center" allowSort="true">新生儿/引产儿性别</div>
                    <div field="nbcBirthdayOrChildbirthDate" width="120" headerAlign="center" align="center" allowSort="true">出生/引产日期</div>
                    <div field="nbcBw" width="120" headerAlign="center" align="center" allowSort="true">出生体重</div>
                    <div field="nbcLength" width="120" headerAlign="center" align="center" allowSort="true">出生身长</div>
                    <div field="nbcHeadCircumference" width="120" headerAlign="center" align="center" allowSort="true">头围</div>
                    <div field="oneApgar" width="120" headerAlign="center" align="center" allowSort="true"> 1分钟阿氏评分</div>
                    <div field="fiveApgar" width="120" headerAlign="center" align="center" allowSort="true"> 5分钟阿氏评分</div>
                    <div field="gestDays" width="120" headerAlign="center" align="center" allowSort="true">出生孕龄/引产孕龄</div>
                    <div field="birthPlace" width="120" headerAlign="center" align="center" allowSort="true">出生地点</div>
                    <div field="birthInspection" width="120" headerAlign="center" align="center" allowSort="true">出生检查</div>
                    <div field="flupCure" width="120" headerAlign="center" align="center" allowSort="true">后续治疗</div>
                    <div field="inducedSpecial" width="120" headerAlign="center" align="center" allowSort="true">引产特殊情况</div>
                    <div field="inducedCauseName" width="120" headerAlign="center" align="center" allowSort="true">引产原因</div>
                    <div field="isSpecKeep" width="120" headerAlign="center" align="center" allowSort="true">是否留存标本</div>
                    <div field="specKeepName" width="120" headerAlign="center" align="center" allowSort="true">标本名称</div>
                    <div field="isPme" width="120" headerAlign="center" align="center" allowSort="true">尸检结果</div>
                    <div field="flupRemark" width="120" headerAlign="center" align="center" allowSort="true">随访备注</div>

                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    mini.parse();

    var form = new mini.Form("#form1");
    var grid = mini.get("datagrid1");
    grid.load();
    function export_file(){
        form.validate();
        if (form.isValid()===false) return;


        // var formData = form.getData(true, true);
        // HttpUtil.standardPost('/cqzd/patientInfo/getFollowUpInfoExport', {});
    }

    function onValueChanged() {
        search();
    }
    function search(){
        //校验
        form.validate();
        if (form.isValid()===false) return;

        var formData = form.getData(true, true);

        //var json = mini.encode(formData);
        grid.load(formData);
    }

    function resetForm(){
        form.reset();
    }


    let loadData = function () {
        let  loadA   = new Promise(resolve => {
            HttpUtil.post("/cqzd/patientInfo/getAllDiagnosisInfo",function (res){
                resolve(res.data);
            });
        });
        // let loadB = new Promise(resolve => {
        //     HttpUtil.post("/cqzd/do/basepatient/queryList",{pageSize:5000},function (res){
        //         resolve(res.data)
        //     });
        // })
        // let loadC  = new Promise(resolve=> {
        //     HttpUtil.get("/cqzd/patientInfo/getFollowUpInfo?pageIndex=0&pageSize=25&sortField=&sortOrder=&_=1629947775250", function (res){
        //         resolve(res.data)
        //     });
        // })

        // let  loadD  = new Promise(resolve=> {
        //     HttpUtil.get("/cqzd/patientInfo/getFollowUpInfo?pageIndex=0&pageSize=25&sortField=&sortOrder=&_=1629957232221", function (res){
        //         resolve(res.data)
        //     });
        // })

        // let  loadE =  new Promise(resolve=> {
        //     HttpUtil.get("/cqzd/patientInfo/getPuncture?pageIndex=0&pageSize=25&sortField=&sortOrder=&_=1630046561274", function (res) {
        //         resolve(res.data)
        //     })
        // })

        // loadA

        // Promise.all([  loadA,    ]).then(result => {
        //     // let tableData = [];
        //     // console.log(result)
        //     // tableData = result[3];
        //     // grid.setData(tableData);
        //
        //     let tableData = result.reduce((arr,item)=>{
        //         return arr.concat(item)
        //     },[]);-
        //         console.log(111,tableData)
        //     grid.setData(tableData);
        //
        //     let arr1 = [{code:'a',name:'n1'},{code:'b',name:'n1'},{code:'c',name:'n1'}];
        //     // let arr2 = [{code:'a',age:'11'},{code:'b',age:'23'},{code:'c',age:'56'}];
        //     // let arr3 = [{code:'b',gender:'f'},{code:'a',gender:'f'},{code:'c',gender:'m'},{code:'d',gender:'f'}];
        //
        //     let tableData2 = [];
        //
        //     // arr2.forEach(item => {
        //     //     tableData2.push(item)
        //     // });
        //
        //     tableData2.forEach(item => {
        //
        //         let eqArr = arr1.filter( arrItem => {
        //             return arrItem.code === item.code
        //         });
        //
        //         if (eqArr.length){
        //             Object.keys(eqArr[0]).forEach(key => {
        //                 item[key] = eqArr[0][key]
        //             })
        //         }
        //
        //         eqArr = arr3.filter( arrItem => {
        //             return arrItem.code === item.code
        //         })
        //         if (eqArr.length){
        //             Object.keys(eqArr[0]).forEach(key => {
        //                 item[key] = eqArr[0][key]
        //             })
        //         }
        //         mini.get("datagrid2").setData(tableData2);
        //
        //
        //     })
        //
        //
        //
        // })
    }
    // loadData();






    //双击事件
    function rowdblclick(e) {
        var row = e.row;
        console.log(row)
        $.ajax({
            url:moduleUlr+"getDiacrisisInfo/"+row.diacrisisId,
            type: "get",
            processData:false,
            contentType : false,
            success: function (result){
                console.log(result);
                mini.open({
                    url: modulePageUlr + "diacrisis_detail.html",
                    title: "查看诊断信息", width: 1100, height: 760,
                    onload: function () {
                        var iframe = this.getIFrameEl();
                        var data = result;
                        iframe.contentWindow.SetData(data);
                    },
                    ondestroy: function (action) {
                        if(action=="ok"){
                            grid.reload();
                        }
                    }
                });
            }
        })
    }

    function onValueChanged() {
        search();
    }
    function export_file(){
        // //var winLoading=mini.loading("数据量较大,正在准备数据,请稍等...","等待提示");
        // mini.showTips({
        //     content:"数据量较大,正在准备数据,请耐心稍等...",
        //     state: "warning",
        //     x: "center",
        //     y: "top",
        //     timeout: 60000});
        // form.validate();
        // if (form.isValid()==false) return;
        // var formData = form.getData(true, true);
        // HttpUtil.standardPost('/cqzd/patientInfo/getAllDiagnosisInfoExport', formData);
        // //mini.hideMessageBox(winLoading);
        // window.open("/cqzd/patientInfo/getAllDiagnosisInfoExport");
        // var formData = form.getData(true, true);
        // HttpUtil.standardPost("/cqzd/patientInfo/getAllDiagnosisInfoExport",formData)
        var formData = form.getData(true, true);
        HttpUtil.standardPost("/cqzd/patientInfo/getAllDiagnosisInfoExport",formData);
    }


    function search(){
        //校验
        form.validate();
        if (form.isValid()===false) return;

        var formData = form.getData(true, true);

        //var json = mini.encode(formData);
        grid.load(formData);
    }

    function resetForm(){
        form.reset();
    }
    $(function () {
        $(".mini-autocomplete .mini-buttonedit-input").attr("placeholder","请输入登记编号/姓名/身份证");
    });



</script>

</body>
</html>
